package com.ruoyi.project.cms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.cms.domain.Article;
import com.ruoyi.project.cms.mapper.ArticleMapper;

@Service
public class ArticleService {
	@Autowired
	private ArticleMapper articleMapper;

	public Article selectArticle(Integer id) {
		return articleMapper.selectArticle(new Article(id));
	}

	public List<Article> selectArticleList(Article article) {
		return articleMapper.selectArticleList(article);
	}

	public int save(Article article) {
		return articleMapper.insertArticle(article);
	}

	public int deleteById(String ids) {
		return articleMapper.deleteArticleByIds(Convert.toStrArray(ids));
	}

	public int updateArticle(Article Article) {
		return articleMapper.updateArticle(Article);
	}

}
